package com.my.demo.resource.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * Created by LeiXuMeng on 2017/7/14.
 */
@RestController
public class ResourceController {
    @RequestMapping("/hello")
    public String hello() {
        return "Hello World";
    }

    @RequestMapping({"/user", "/me"})
    @ResponseBody
    public Principal user(Principal user) {
        return user;
    }
}
